package mysqloperate;

import people.User;

import java.sql.Connection;
import java.sql.Statement;

public class updateuserpassword {
    public static void updata(User user,String updatepassword)throws Exception{
        String sql="update user set password='"+updatepassword+"'where zhanghao='"+user.getId()+"'";
        connection con=new connection();
        Connection connection=con.getconnection();
        Statement statement=connection.createStatement();
        int num=statement.executeUpdate(sql);
        statement.close();
        connection.close();
    }
}
